<template>
    <div class="block">
        <m-title :content="content"></m-title>
        <div class="ship" v-if="onwer&&(onwer.post_onwer_id ||　onwer.post_permission_id)">
            <div style="padding-top:.16rem" v-if="onwer.post_onwer_id?onwer.is_owner_sale == '1'&&onwer.status=='1':onwer.is_peimission_sale=='1'&&onwer.status=='1'">
                <div class="ownership">
                    <div class="ownership_main">
                        <div>
                            <p class="hui font_12 ownership_main_title">类型</p>
                            <p class="font_18">{{onwer.post_onwer_id?'所有权':'许可权'}}</p>
                        </div>
                        <div>
                            <p class="hui font_12 ownership_main_title">数量</p>
                            <p class="font_18">{{onwer.num || onwer.remaining_num}}</p>
                        </div>
                        <div>
                            <p class="hui font_12 ownership_main_title">价格</p>
                            <p class="font_18">{{onwer.price}}</p>
                        </div>
                    </div>
                    <button v-show="!myself && (onwer.num == 0 || onwer.remaining_num == 0)" class="hui_button button">
                        已售空
                    </button>
                    <button @click="$router.push(
                        `/transaction/buy?id=${onwer.post_onwer_id ||　onwer.post_permission_id}&max=${onwer.num || onwer.remaining_num || 1}&price=${onwer.price}&name=${content.name}&type=${content.type}&onwer_type=${onwer.post_onwer_id}&back=${$route.fullPath}`)" 
                        v-show="!myself && (onwer.num > 0 || onwer.remaining_num > 0)" 
                        class="red_botton button">
                        购买
                    </button>
                    <div v-show="myself" class="ownership_bottom">
                        <div></div>
                        <div class="button_g">
                            <div @click="$router.push(`/transaction/sell`)" class="button_item">
                                出售知识产权
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import title from './title'
export default {
    props: {
        myself: {
            type: Boolean,
            default: false
        },
        onwer: {
            type: Object,
            default: () => {}
        },
        content:{
            type:Object,
            default:() =>{}
        }
    },
    components: {
        mTitle: title
    },
    data() {
        return {}
    },
    created() {}
}
</script>

<style scoped>
.ownership_bottom {
    margin-top: 0.24rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.button_item {
    padding: 0.12rem 0.24rem;
    border: 1px solid rgba(151, 151, 151, 1);
    border-radius: 4px;
}
.block {
    padding: 0.24rem;
    background: #fff;
    padding-bottom: 0;
    min-height: .1rem
}
.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: .24rem
}
.title_main {
    font-size: 0.36rem;
    font-weight: 600;
    margin-bottom: 0.08rem;
}
.ownership_main {
    display: flex;
    justify-content: space-between;
}
.ownership_main > div {
    width: 33.33%;
}
.ownership_main_title {
    margin-bottom: 0.16rem;
}
.hui_button {
    background: rgba(216, 216, 216, 1);
    border-radius: 4px;
    color: #fff;
}
.red_botton {
    border-radius: 4px;
    color: #be2328;
    border: 1px solid rgba(190, 35, 40, 1);
    background: #fff;
}
.button {
    margin-top: 0.36rem;
    width: 100%;
    height: 0.96rem;
    line-height: 0.96rem;
    text-align: center;
    font-size: 0.36rem;
    margin-bottom: 0.24rem;
}
.ownership_bottom {
    height: 1.3rem;
    width: 100%;
    border-top: solid 0.5px rgb(240, 240, 240);
}
</style>
